//
//  UIButton+Extension.swift
//  WeiBo
//
//  Created by Feng on 2017/6/8.
//  Copyright © 2017年 feng. All rights reserved.
//

import UIKit

extension UIButton
{
    convenience init(title: String, titleColor: UIColor, fontSize: CGFloat, image: UIImage? = nil, backgroundImage: UIImage? = nil)
    {
        self.init()
        
        self.setTitle(title, for: .normal)
        self.setTitleColor(titleColor, for: .normal)
        self.titleLabel?.font = UIFont.systemFont(ofSize: fontSize)
        self.setImage(image, for: .normal)
        self.setBackgroundImage(backgroundImage, for: .normal)
        self.adjustsImageWhenHighlighted = false
    }
}
